package com.example.backend.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Response<T> {
    int statusCode;
    String message;
    T data;

    public static <T> Response<T> Ok(String message, T data) {
        return new Response<>(
                ResponseStatus.OK.getValue(),
                message,
                data
        );
    }

    public static <T> Response<T> Error(String message, T data) {
        return new Response<>(
                ResponseStatus.ERROR.getValue(),
                message,
                data
        );
    }
}
